import 'package:flutter/material.dart';

class HomePage extends StatefulWidget {
  HomePage({Key key}) : super(key: key);

  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      mainAxisAlignment: MainAxisAlignment.center,
      children: <Widget>[
        RaisedButton(
          child: Text("跳到搜索页"),
          onPressed: () {
            // Navigator.of(context).push(
            //   MaterialPageRoute(
            //     builder: (context) => SearchPage()
            //   )
            // );
            Navigator.pushNamed(context, '/search', arguments: {
              "id": 123
            });
          },
          color: Theme.of(context).accentColor,
          textTheme: ButtonTextTheme.primary,
        ),

        SizedBox(height: 20),
        RaisedButton(
          child: Text("跳到表单也并传值"),
          onPressed: () {
            Navigator.pushNamed(context, '/form');
          },
          color: Theme.of(context).accentColor,
          textTheme: ButtonTextTheme.primary,
        ),
        
        SizedBox(height: 20),
        RaisedButton(
          child: Text("跳到appBar"),
          onPressed: () {
            Navigator.pushNamed(context, '/appBarDemo');
          }
        ),

        SizedBox(height: 20),
        RaisedButton(
          child: Text("按钮们"),
          onPressed: () {
            Navigator.pushNamed(context, '/appBarDemo');
          }
        ),
      ],
    );
  }
}